home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
MiscKit1.7.1
/
MiscKit
/
Palettes
/
MiscTabMatrixPalette
/
MiscTabActionCell.subproj
/
drawTab.psw
next >
Wrap
Text File
|
1995-02-03
|
2KB
|
74 lines
/* $Id$ */
/*
* Draws the beginning (left) edge of the tab. y coordinate is flipped.
* xo, yo - the origin of the drawing
* wcurve - the curve width
* htab - tab height
* strokegray - gray used to stroke the curve
* fillgray - gray used to fill the curve
*/
defineps Misc_drawLeftTabBezier(int xo, yo, wcurve, htab; float strokegray,
fillgray)
/leftCurve {
xo yo moveto
% x0 y0 y0 x0 y1 x1 x1 ...x1 ...x2 y2 y2
currentpoint exch wcurve 2 div add dup 3 1 roll yo htab sub dup
% ...y2 x3 ...x3 y3
xo wcurve add exch curveto
} bind def
% Draw and fill bezier curve.
newpath
leftCurve
0 htab rlineto
closepath
fillgray setgray fill
% Draw and stroke bezier curve.
leftCurve
strokegray setgray stroke
endps
/*
* Draws the end (right) edge of the tab.
*/
defineps Misc_drawRightTabBezier(int xo, yo, wcurve, htab; float strokegray,
fillgray)
/wbez wcurve 2 div def
/rightCurve {
xo yo htab sub moveto
% x0 y0 y1 x1 x1 x1 y1 x1 x1 ...x1 x1 y2 y2 ...x2 y2 y2 x2
currentpoint exch wbez add dup 3 1 roll dup yo dup 3 1 roll exch
% ...y2 x3 ...x3 y3
wbez add exch curveto
} bind def
% Draw and fill bezier curve.
newpath
rightCurve
wcurve neg 0 rlineto
closepath
fillgray setgray fill
% Draw and stroke bezier curve.
rightCurve
currentpoint % Leave current point on stack.
strokegray setgray stroke
% Blend end of curve with abutting line. Some sort of rounding error (?)
% requires y adjustment of 1 unit.
1 sub moveto
-2 0 rlineto
0.5 setgray stroke
% Blend start of curve with abutting line.
xo yo htab sub moveto
1 0 rlineto
fillgray setgray stroke
endps